import {request} from "../request/index.js";
import {config} from "../config/index.js";

// 得到音乐源地址
async function songSrc(id, callBack, handle) {
    let params = {
        id
    }
    await request.get(config.url.songUrl.songSrc, params).then(callBack).catch(handle)
}

// 得到歌词
async function lyric(id, callBack, handle) {
    let params = {
        id
    }
    await request.get(config.url.songUrl.lyric, params).then(callBack).catch(handle)
}

// 获取歌曲详情
async function songDetail(ids,callBack, handle) {
    let params = {
        ids
    }
    await request.get(config.url.songUrl.songDetail, params).then(callBack).catch(handle)
}

// 得到歌曲评论
async function songComment(id, limit, offset, before) {

}

export const songApi = {
    songSrc,
    lyric,
    songDetail
}